<template>
    <div class="mainStyle">
        <div class="topButton">
            <el-dropdown @command="command" trigger="click" size="small">
                <!-- <span>
                    {{ text }}<i class="el-icon-arrow-down el-icon--right"></i>
                </span> -->
                <el-button size="mini" type="primary" icon="el-icon-plus" class="buttonStyle">{{ text }}</el-button>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item :command="item" v-for="(item, index) in list1" :key="index">{{ item.text
                        }}</el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
        </div>
        <div class="top2Button">
            <div style="margin-left: 1%;">
                <el-dropdown @command="command1" size="small">
                    <span>
                        {{ text1 }}<i class="el-icon-arrow-down el-icon--right"></i>
                    </span>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item :command="item" v-for="(item, index) in list1" :key="index">{{ item.text
                            }}</el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>
            </div>
        </div>
        <div class="tableStyle">
            <myTable :data="tableData"></myTable>
        </div>
        <div class="pageStyle">
            <el-pagination background :total="queryAll.totalNum" :page-size="queryAll.pagesize"
                :page-sizes="[5, 10, 15, 20]" :current-page.sync="queryAll.startpage" @current-change="currentChange"
                @size-change="handleSizeChange" layout="total,sizes,prev, pager, next,jumper">
            </el-pagination>
        </div>
    </div>
</template>

<script>
import myTable from "./myTable.vue";
export default {
    name: 'manifestInformation',
    components: { myTable },
    data() {
        return {
            text: "舱单申报",
            text1: "舱单类型",
            list1: [
                {
                    text: '预配舱单',
                    path: "preFurnishedManifest",
                    value: 1,
                },
                {
                    text: '原始舱单',
                    path: "originalManifest",
                    value: 2,
                },
                {
                    text: '装载舱单',
                    path: "shippingManifest",
                    value: 3,
                },
            ],
            tableData: [
                {
                    nowTime: "2024-4-25 11:00:05",
                    flightNumber: "LB250",
                    transportName: "浙B25045",
                    transportType: "海运",
                    carrierCode: "LB941250",
                    creatTime: "2024-4-25 11:02:30"
                },
                {
                    nowTime: "2024-4-25 11:00:05",
                    flightNumber: "CB250",
                    transportName: "浙B41250",
                    transportType: "海运",
                    carrierCode: "SB941250",
                    creatTime: "2024-4-25 11:02:30"
                },
                {
                    nowTime: "2024-4-25 11:00:05",
                    flightNumber: "CB250",
                    transportName: "浙B41250",
                    transportType: "海运",
                    carrierCode: "SB941250",
                    creatTime: "2024-4-25 11:02:30"
                },
                {
                    nowTime: "2024-4-25 11:00:05",
                    flightNumber: "CB250",
                    transportName: "浙B41250",
                    transportType: "海运",
                    carrierCode: "SB941250",
                    creatTime: "2024-4-25 11:02:30"
                },
                {
                    nowTime: "2024-4-25 11:00:05",
                    flightNumber: "CB250",
                    transportName: "浙B41250",
                    transportType: "海运",
                    carrierCode: "SB941250",
                    creatTime: "2024-4-25 11:02:30"
                },
                {
                    nowTime: "2024-4-25 11:00:05",
                    flightNumber: "CB250",
                    transportName: "浙B41250",
                    transportType: "海运",
                    carrierCode: "SB941250",
                    creatTime: "2024-4-25 11:02:30"
                },
            ],
            queryAll: {
                startpage: 0,
                pagesize: 5,
                totalNum: 6,
            },
        }
    },
    created() {
    },
    methods: {
        command(v) {
            this.text = v.text
            this.$router.push(v.path)
        },
        command1(v) {
            this.text1 = v.text
        },
        currentChange(e) {
            this.queryAll.startpage = e
        },
        handleSizeChange(e) {
            this.queryAll.startpage = 1
            this.queryAll.pagesize = e
        },
    },

    computed: {},

    mounted() {
    },
}
</script>
<style lang='scss' scoped>
.mainStyle {
    background-color: #fff;
    padding: 16px 14px;
    min-height: 800px;
    position: relative;

    .topButton {
        width: 100%;
        display: flex;
        justify-content: flex-end;

        .buttonStyle {
            background-color: #0F47B8;
        }
    }

    .top2Button {
        margin-top: 1%;
        // margin-left: 2%;
        display: flex;
        align-items: center;
        width: 100%;
        height: 32px;
        background-color: #F5F5F5;
    }

    .tableStyle {
        overflow: auto;
        width: 100%;
        position: relative;
    }

    .pageStyle {
        text-align: right;
        margin-top: 20px;
    }
}

:deep .el-dropdown-menu__item:focus,
.el-dropdown-menu__item:not(.is-disabled):hover {
    background-color: #0F47B8;
    color: #fff;
}
</style>